package internet;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class ClientDemo1 {
    public static void main(String[] args) throws IOException {

        // 创建客户端
        Socket s = new Socket("192.168.0.102", 10001);
        OutputStream stream = s.getOutputStream();
        stream.write("i i i i ".getBytes());
        // 接受反馈
        InputStream is = s.getInputStream();
        byte[] bytes = new byte[1024];
        int len = is.read(bytes);
        String s1 = new String(bytes, 0, len);
        System.out.println("client:" + s1);

        s.close();
    }
}
